import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;

//仅仅反转字母
public class Test2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        System.out.println(reverseOnlyLetters(s));
    }
    public static String reverseOnlyLetters(String s) {
       //双指针
        int n = s.length();
        int left = 0,right = n-1;
        char[] chars = s.toCharArray();
        while (left<n&&right>=0){
            char ch1 = s.charAt(left);
            char ch2 = s.charAt(right);
            if(!Character.isLetter(ch1)){
                //用左指针来判断是否是符号
                left++;
            }
            else if (!Character.isLetter(ch2)) {
                //右指针判断出是符号,那就直接跳过
                right--;
            }
            else{
                chars[left] = ch2;
                chars[right] = ch1;
                right--;
                left++;
            }
        }
        return new String(chars);
    }
}
